from sqlalchemy import BigInteger, Column, DateTime, CHAR, String

from config.database import Base


class Account(Base):
    """
    股票账号表
    """

    __tablename__ = 'stock_account'
    __table_args__ = {'comment': '股票账号表'}

    id = Column(BigInteger, primary_key=True, autoincrement=True, nullable=False, comment='主键ID')
    account_no = Column(String(64), nullable=False, comment='账号')
    account_tag = Column(String(10), nullable=True, comment='账号标签')
    broker = Column(String(100), nullable=False, comment='券商')
    account_name = Column(String(100), nullable=False, comment='账号名')
    miniqmt = Column(CHAR(1), nullable=False, comment='MiniQMT')
    del_flag = Column(CHAR(1), nullable=True, server_default='0', comment='删除标志')
    create_by = Column(String(64), nullable=True, comment='创建者')
    create_time = Column(DateTime, nullable=True, comment='创建时间')
    update_by = Column(String(64), nullable=True, comment='更新者')
    update_time = Column(DateTime, nullable=True, comment='更新时间')
    remark = Column(String(500), nullable=True, comment='备注')
